package demo3;


/**
 * Created with IntelliJ IDEA.
 * User: 12629
 * Date: 2022/2/24
 * Time: 21:29
 * Description:
 */
interface IShape {
    /*public int a1=1;
    public static int a2=2;
    public static final int a3 = 3;
    int a4 = 10;*/
    /*
     default public void test(){
        System.out.println("这就是一个默认的方法");
    }
    public static void test2() {
        System.out.println();
    }*/
     void draw();
}
class Cycle implements IShape{

    @Override
    public void draw() {
        System.out.println("画●！");
    }

   /* @Override
    public void test() {
        IShape.super.test();
    }*/
}
class Rect implements IShape {
    @Override
    public void draw() {
        System.out.println("画♦！");
    }
}
class Flower implements IShape {
    @Override
    public void draw() {
        System.out.println("画❀！");
    }
}
class Triangle implements IShape {
    @Override
    public void draw() {
        System.out.println("画△！");
    }
}



public class TestDemo {


    public static void drawMap(IShape shape) {
        shape.draw();
    }


    public static void main(String[] args) {
        //IShape iShape = new IShape();

        IShape iShape1 = new Cycle();
        IShape iShape2 = new Rect();
        IShape iShape3 = new Flower();

        drawMap(iShape1);
        drawMap(new Cycle());

        drawMap(iShape2);
        drawMap(iShape3);

    }
}
